import styles from './tag.less';
import TagHead from '@/components/tag/tagHead/taghead';
import TagMiddle from '@/components/tag/tagMiddle/tagMiddle';
import TagFoot from '@/components/tag/tabFoot/tagFoot';
import {
  IRouteComponentProps,
  useDispatch,
} from 'umi';
import Upperright from '@/components/rightcomp/upperright/upperright';
import RightLowerOther from '@/components/rightcomp/rightlowerother/rightlowerother';
import { useEffect } from 'react';
const bash: React.FC<IRouteComponentProps<{ id: string }>> = (props) => {
  const id = props.match.params.id;
  localStorage.setItem('tagid', id);
  // 获取tagDetail数据
  const dispatch = useDispatch();
  useEffect(() => {
    dispatch({
      type: 'tag/getTagDetail',
      payload: id,
    });
  }, [id]);
  useEffect(() => {
    dispatch({
      type: 'tag/getTagDetailList',
      payload: id,
    });
  }, [id]);
  useEffect(() => {
    dispatch({
      type: 'tag/getTag',
      payload: id,
    });
  }, []);
  return (
    <div className={styles.index}>
      <div className={styles.left}>
        <TagHead />
        {/* <TagMiddle id={id} tag={tag.tag}/> */}
        <TagMiddle/>
        <TagFoot/>
      </div>
      <div className={styles.right}>
        <Upperright />
        <RightLowerOther />
      </div>
    </div>
  );
};
export default bash;
